home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_tem_lavabubdash2.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  111 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEM_LavaBubbles.cog
  4. #
  5. # [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message     entered
  13.     message     pulse
  14.     
  15.     thing       blurp           local
  16.     thing       bloop0
  17.     thing       bloop1
  18.     thing       bloop2
  19.     thing       bloop3
  20.     thing       bloop4
  21.     
  22.     sector      sec_Start1
  23.     sector      sec_Start2
  24.     sector      sec_Stop1
  25.     sector      sec_Stop2
  26.     
  27.     template    tpl_Bubble=lavabubopp       local
  28.     template    tpl_Sparks=lavasparks       local
  29.  
  30.     material    bubbleSkin=bubble_a4lava_top.mat        local
  31.     material    lavaSkin=gen_a4sfx_lava_particle.mat    local
  32.     
  33.     sound       sfx_Bloop0=gen_lava_bloop_a.wav      local
  34.     sound       sfx_Bloop1=gen_lava_blurp_a.wav      local
  35.     
  36.     int         animId      local
  37.     int         newBubble   local
  38.     int         oldBubble   local
  39.     int         bubbling=0  local
  40.     
  41.     
  42. end
  43.  
  44. # ========================================================================================
  45.  
  46. code
  47.  
  48. entered:
  49.  
  50.     if((GetSenderRef() == sec_Start1) || (GetSenderRef() == sec_Start2))
  51.     {
  52.         if(bubbling == 0)
  53.         {
  54.             Print("startBubbles");
  55.             bubbling = 1;
  56.             SetPulse(1.0);
  57.         }
  58.     }
  59.  
  60.     if((GetSenderRef() == sec_Stop1) || (GetSenderRef() == sec_Stop2))
  61.     {
  62.         Print("stopBubbles");
  63.         SetPulse(0.0);
  64.         bubbling = 0;
  65.     }
  66.     
  67.     return;
  68.  
  69. # ========================================================================================
  70.  
  71. pulse:
  72.  
  73.     while (newBubble == oldBubble) 
  74.     {
  75.         newBubble = RandBetween(0, 4);
  76.     }
  77.     
  78.     oldBubble = newBubble;
  79.     
  80.     # create bubble at random position
  81.     blurp = CreateThing(tpl_Bubble, bloop0[newBubble]);
  82.     CaptureThing(blurp);
  83.     
  84.     # move bubble to frame
  85.     MoveToFrame(blurp, 1, 1.5);
  86.     
  87.     # animate the bubble mat
  88.     SetMaterialCel(bubbleskin, 0);
  89.     animId = MaterialAnim(bubbleskin, 48, 0);
  90.     
  91.     # play the bloop/blurp sfx
  92.     PlaySoundThing(sfx_Bloop0[RandBetween(0, 1)], blurp, 1.0, 10.0, 20.0, 0x0);
  93.     
  94.     # create lava sparks
  95.     SetMaterialCel(lavaskin, 0);
  96.     CreateThing(tpl_Sparks, bloop0[newBubble]);
  97.     MaterialAnim(lavaskin, 4, 0);
  98.     
  99.     # get ready for the next one
  100.     WaitForStop(blurp);
  101.     Sleep(0.45);
  102.     #StopAnim(animId);
  103.     DestroyThing(blurp);
  104.     
  105.     return;
  106.  
  107. # ========================================================================================
  108.  
  109. end
  110.  
  111.